package com.t235.gc.order.service;

import com.t235.gc.dao.HomeRecyclingOrderDao;
import com.t235.gc.entity.HomeRecyclingDetailOrder;
import com.t235.gc.entity.HomeRecyclingOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HomeRecyclingOrderService {
    @Autowired
    private HomeRecyclingOrderDao homeRecyclingOrderDao;

    public List<HomeRecyclingOrder> selectOrderByOrderStatus(Long userId, int orderStatus) {
        return homeRecyclingOrderDao.selectOrderByOrderStatus(userId,orderStatus);
    }

    public List<HomeRecyclingDetailOrder> selectOrderByOrderId(String orderId) {
        return homeRecyclingOrderDao.selectOrderByOrderId(orderId);
    }


    public int updateOrderStatus(String orderId,int orderStatus) {
        return homeRecyclingOrderDao.updateOrderStatus(orderId,orderStatus);
    }


    public void delHomeRecyclingOrder(String orderId) {
        homeRecyclingOrderDao.delHomeRecyclingOrder(orderId);
        homeRecyclingOrderDao.delHomeRecyclingDetailOrder(orderId);
    }
}
